package com.taotao.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.taotao.common.utils.DateUtil;
import com.taotao.mapper.EyRemindLogMapper;
import com.taotao.pojo.EyRemindLog;
import com.taotao.service.ParamService;
import com.taotao.service.RemindLogService;

@Service
public class RemindLogServiceImpl implements RemindLogService {

	@Autowired
	EyRemindLogMapper eyRemindLogMapper;
	
	@Autowired
	ParamService paramService;
	
	@Override
	public void insert(String sessionKey,String messageId,String sender, String receiver, String content, String errcode, String errmsg, String type) {
		EyRemindLog log=new EyRemindLog();
		log.setSessionKey(sessionKey);
		if(StringUtils.isNotBlank(messageId)){
			log.setMessageId(Integer.parseInt(messageId));
		}
		log.setSender(Integer.parseInt(sender));
		log.setReceiver(Integer.parseInt(receiver));
		log.setContent(content);
		log.setErrcode(errcode);
		log.setErrmsg(errmsg);
		log.setType(type);
		log.setCreateTime(DateUtil.getDateAndTime());
		log.setUpdateTime(DateUtil.getDateAndTime());
		eyRemindLogMapper.insert(log);	
		
	}
}
